public class demo12 {
    public static void main(String[] args) {
        int a = 0;
        int sum = 0;
        for (int i = 1; i <=1000; i++) {
            String x = i+"";
            for (int j = 0; j <x.length(); j++) {
                if (x.charAt(j) == '3'){
                    System.out.print(i+"\t");
                    sum++;
                    a+=1;
                    if (a == 15) {
                        System.out.println();
                        a = 0;
                    }
                    break;
                }
            }
        }
        System.out.println();
        System.out.println("一共有:"+sum+"个");
    }
}
